def fn(a,n):
    sum_a,sum = 0,0
    for i in range(n):
        sum_a = sum_a*10 + a
        sum += sum_a
    return sum
a,b=input().split()
s=fn(int(a),int(b))
print(s)